{% extends "base.html" %}
{% load i18n dv_filters %}

{% block head_title %}{% blocktrans with year=export_period.year month_start=export_period.season|season_month_start month_end=export_period.season|season_month_end %}Statistiques des mois {{ month_start }} à {{ month_end }} {{ year }}{% endblocktrans %}{% endblock %}

{% block content %}
{% include 'info/_season_nav.html' with nav_url=nav_url previous_period=previous_period next_period=next_period only %}
{% with season=export_period.season year=export_period.year %}

{% if dataset %}
    <h1>{{ dataset_title }}</h1>
    {% include 'export_buttons.html' with noprint=True exporturl=dataset_exporturl year=year season=season only %}
    <table class="table">
      <thead>
        <tr>
        {% for entry in dataset.headers %}
            <th>{{ entry|default:'' }}</th>
        {% endfor %}
        </tr>
      </thead>
    {% for row in dataset %}
        <tr>
        {% for entry in row %}
            {% if forloop.first %}
                <th>{{ entry|ifcanton_abbr|default:'' }}</th>
            {% else %}
                <td>{{ entry|default:'' }}</td>
            {% endif %}
        {% endfor %}
        </tr>
    {% endfor %}
    </table>
{% else %}
    <h1>{% blocktrans with year=export_period.year month_start=export_period.season|season_month_start month_end=export_period.season|season_month_end %}Statistiques des mois {{ month_start }} à {{ month_end }} {{ year }}{% endblocktrans %}</h1>

    <ul>
        <li><a href="{% url 'season-stats' year=year dv_season=season %}">{% trans "Statistiques de la saison" %}</a></li>
        <li><a href="{% url 'logistics' year=year dv_season=season %}">{% trans "Logistique vélos" %}</a></li>
    </ul>
{% endif %}
{% endwith %}
{% endblock %}
